<template>
  <div>
    <table>
      <tr>
        <td>
          密码：
        </td>
        <td>
          <input type="text" v-model="password">
        </td>
      </tr>
      <tr>
        <td>
        </td>
        <td>
          <button @click="updata">修改密码</button>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
    export default {
        name: "updatapas",
      data:function () {
        return{
          password:'',
        }
      },
      methods:{
          updata:function () {
            this.axios({
              url:'http://127.0.0.1:8000/updatapas/',
              method:'get',
              params:{uid:localStorage.getItem('uid'), password: this.password}
            }).then(res=>{
              if(res.data.code===200){
                alert(res.data.message);

                this.$router.push('/')
              }else {
                alert(res.data.message)
              }
            })
          }
      }
    }
</script>

<style scoped>

</style>
